<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('article_type', function (Blueprint $table) {
            $table->id();
            $table->string('name', 20)->default('')->comment('分类名称');
            $table->integer('sort')->default(0)->comment('排序（值越大越靠前）');
            $table->tinyInteger('status')->default(0)->comment('状态:1=正常,2=禁用');
            $table->tinyInteger('is_delete')->default(0)->comment('是否删除:1=删除,0=正常');
            $table->integer('created_at')->default(0)->comment('创建时间');
            $table->integer('updated_at')->default(0)->comment('修改时间');
        });
        DB::statement("ALTER TABLE `article_type` comment '【文章】文章分类'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('article_type');
    }
};
